home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / lib / tex / inputs / changebar.sty < prev    next >
Encoding:
Text File  |  1991-05-21  |  19.5 KB  |  586 lines

  1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. %
  3. %    CHANGEBAR STYLE
  4. %
  5. %    Written by:
  6. %        Michael Fine
  7. %        Distributed Systems Architecture.
  8. %        October, 1986.
  9. %
  10. %       Revisions:
  11. %            Support for twosided.sty added.    January, 1987.
  12. %        
  13. %        Warning message added to indicate that another pass is
  14. %        required. May, 1987.
  15. %
  16. %
  17. % USAGE:
  18. %    \cbstart[dimension]
  19. %    \cbend
  20. %    All material between the two macros is barred.  Nested
  21. %    changebars are allowed.  The optional parameter specifies the
  22. %    width of the bar.  If no width is specified, the current value
  23. %    of the parameter \changebarwidth is used.  Note that \cbstart
  24. %    and \cbend can be used anywhere but must be correctly nested
  25. %    with floats and footnotes.  That is, you cannot have one end of
  26. %    the bar inside a floating insertion and the other outside, but
  27. %    that would be a meaningless thing to do anyhow.
  28. %     \setlength{\changebarwidth}{dimension}
  29. %     Sets the default width of the bar. 
  30. %     \setlength{\changebarsep}{dimension}
  31. %     Sets the separation between the bar and the left margin of the
  32. %     text.
  33. % IMPORTANT NOTE: Just as with cross references and labels, you
  34. % usually need to process the document twice (and sometimes three
  35. % times) to ensure that the changebars come out correctly.  However, a
  36. % warning will be given if another pass is required.
  37. %
  38. %
  39. % PARAMETERS:
  40. %
  41. %    \changebarwidth
  42. %    A LaTeX length parameter that gives the bar width.  It can be
  43. %    changed with the \setlength command.  Changing its value affects
  44. %    all subsequent changebars subject to the scoping rules of
  45. %    \setlength.
  46. %
  47. %    \changebarsep
  48. %    A LaTeX length parameter that gives the separation of the bar
  49. %    from the left margin of the text.  It can be set with the
  50. %    \setlength command.
  51. %
  52. %
  53. %  
  54. % FEATURES:
  55. %    Changebars may be nested within each other.  Each level of
  56. %    nesting can be given a different thickness bar.
  57. %     Changebars may be nested in other environments including floats
  58. %     and footnotes.
  59. %     Changebars are applied to all the material within the ``barred''
  60. %     environment, including floating bodies regardless of where the
  61. %     floats float to.  An exeception to this is margin floats.
  62. %     Changebars may cross page boundaries.
  63. % DEFICIENCIES AND BUGS:
  64. %    The macros blindly use specials points \cb@minpoint through
  65. %    \cb@maxpoint.  If this conflicts with another set of macros, the
  66. %    results will be unpredictable.  (What is really needed is a
  67. %    \newspecialpoint, analogous to \newcount etc.)
  68. %    There is a limit of (\cb@maxpoint-\cb@minpoint+1)/4 bars per
  69. %    page (four special points per bar).  Using more than this number
  70. %    yeilds unpredictable results (but that could be called a feature
  71. %    for a page with so many bars).  This limitation could be
  72. %    increased if desired
  73. %     Internal macro names are all of the form \@cbxxxx.  No checking
  74. %     for conflicts with other macros is done.  
  75. %    This implementation has not been designed for two column
  76. %    printing.
  77. %     The algorithms may fail if a floating insertion is split over
  78. %     multiple pages.  In LaTeX floats are not split but footnotes may
  79. %     be.  The simplest fix to this is to prevent footnotes from being
  80. %     split but this may make TeX very unhappy.
  81. %
  82. %    The \cbend normally gets "attached" to the token after it rather
  83. %    than the one before it.  This may lead to a longer bar than
  84. %    intended.  For example, consider the sequence `word1 \cbend
  85. %    word2'.  If there is a line break between `word1' and `word2'
  86. %    the bar will incorrectly be extended an extra line.  This
  87. %    particular case can be fixed with the incantation `word1\cbend{}
  88. %    word2'.
  89. % BASIC ALGORITHM
  90. %
  91. %    The changebars are implemented using the \specials of the DVI to
  92. %    LN3 translator.  In essence, the start of changebar defines a
  93. %    \special point in the margin at the current vertical position on
  94. %    the page.  The end of a changebar defines another point and then
  95. %    joins the two using the "connect" \special.
  96. %
  97. %    This works fine as long as the two points being connected lie on
  98. %    the same page.  However, if they don't, the bar must be
  99. %    artificially terminated at the page break and restarted at the
  100. %    top of the next page.  The only way to do this (that I can think
  101. %    of) is to modify the output routine so that it checks if any bar
  102. %    is in progress when it ships out a page and, if so, adds the
  103. %    necessary artificial end and begin.
  104. %    
  105. %    The obvious way to indicate to the output routine that a bar is
  106. %    in progress is to set a flag when the bar is begun and to unset
  107. %    this flag when the bar is ended.  This works most of the time
  108. %    but, because of the asynchronous behavior of the output routine,
  109. %    errors occur if the bar begins or ends near a page break.  To
  110. %    illustrate, consider the following scenerio.
  111. %
  112. %    blah blah blah        % page n
  113. %    blah blah blah
  114. %    \cbstart        % this does its thing and set the flag
  115. %    more blah
  116. %        <-------------- pagebreak occurs here
  117. %    more blah
  118. %    \cbend            % does its thing and unsets flag
  119. %    blah blah
  120. %    
  121. %    Since TeX process ahead of the page break before invoking the
  122. %    output routine, it is possible that the \cbend is
  123. %    processed, and the flag unset, before the output routine is
  124. %    called.  If this happens, the necessary artificial end and begin
  125. %    will not be added to page n and n+1, respectively.  Thus, it is
  126. %    not possible to use a flag to signal the output routine that a
  127. %    bar crosses a page break, and some other mechanism is required.
  128. %    
  129. %    The method used with these macros is to create a list of the
  130. %    beginning and end points of each bar in the document together
  131. %    with the page number corresponding to each point.  Then, as a
  132. %    page is completed, a modified output routine checks the list to
  133. %    determine if any bars begun on or before the current page are
  134. %    terminated on subsequent pages, and handles those bars
  135. %    appropriately.  To build the list, information about each
  136. %    changebar is written to the .AUX file as bars are processed.
  137. %    This information is re-read when the document is next processed.
  138. %    Thus, to ensure that changebars are correct, the document must
  139. %    be processed twice, but this is required for LaTeX anyway.
  140. %
  141. %    This apprach is sufficiently general to allow nested bars, bars
  142. %    in floating insertions, and bars around floating insertions.
  143. %    Bars inside floats and footnotes are handled in the same way as
  144. %    bars in regular text.  Bars that encompass floats or footnotes
  145. %    are handled by creating an additional bar that floats with the
  146. %    floating material.  Modifications to the appropriate LaTeX
  147. %    macros check for this condition and add the extra bar.
  148. %
  149. %
  150. %
  151. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  152. %
  153. %    User Level Commands And Parameters
  154. %
  155. %
  156.  
  157. %
  158. % \cbstart    \cbend
  159. %
  160. % Start and end a changebar and save state on \cb@currentlist.  Width of
  161. % new bar is determined by adding \changebarwidth to width of current
  162. % bar.  Does not invoke a LaTeX environment.
  163. %
  164. \def\cbstart{\@ifnextchar [{\cb@xstart}{\cb@start\changebarwidth}}
  165.     \def\cb@xstart[#1]{\cb@start{#1}}
  166.  
  167. \def\cbend{\if e\cb@currentlist
  168.     \message{Badly nested changebars.  Expect erroneous results.}\else
  169.     \cb@end\fi}
  170.  
  171. %
  172. % \begin{changebar}  \end{changebar}
  173. %
  174. % Identical to \cbstart and \cbend but invokes a LaTeX environment to
  175. % enforce correct nesting.  Cannot be used in tabular and tabbing
  176. % environments.
  177. %
  178. %\newenvironment{changebar}{\@bsphack\cbstart\@esphack}{\@bsphack
  179. %    \cbend\@esphack}
  180.  
  181.  
  182. %
  183. % \changebarwidth
  184. %
  185. % A LaTeX length parameter that gives the bar width.  Width of bar is
  186. % given by \changebarwidth multiplied by nesting level.
  187. %
  188. \newlength{\changebarwidth}
  189. \setlength{\changebarwidth}{2pt}
  190.  
  191. %
  192. % \changebarsep
  193. %
  194. % A LaTeX length parameter that gives the separation of the bar from the
  195. % left margin of the text.
  196. %
  197. \newlength{\changebarsep}
  198. \setlength{\changebarsep}{30pt}
  199.  
  200.  
  201. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  202. %
  203. %    Declarations And Initializations
  204. %
  205. %
  206.  
  207. \let\cb@ig=\ignorespaces %useful abreviation
  208.  
  209. \def\cb@maxpoint{80}        % max value of used special points
  210. \def\cb@minpoint{1}        % ditto for min;
  211.                 % MUST BE ODD ****
  212. \def\cb@nil{0}            % a void value for points
  213.  
  214. \newcount\cb@nextpoint        % next value of special point to use
  215. \newcount\cb@currentpoint    % current value in use
  216. \cb@nextpoint=\cb@minpoint    % intially = \cb@minpoint
  217.  
  218. \newcount\cb@page        % count for page value from hist list
  219. \newcount\cb@pagecount        % our internal count of pages output
  220. \cb@pagecount=0            % initially 0 due to timing of increment
  221.  
  222. \xdef\cb@history{e}        % the history list; initially empty
  223. \xdef\cb@spanlist{e}        % list of bars spanning current page
  224. \xdef\cb@currentlist{e}        % used to implement nesting without using
  225.                 % TeX grouping
  226.  
  227.  
  228. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  229. %
  230. %    Macros for beginning and ending bars
  231. %
  232. %
  233.  
  234. %
  235. % \cb@start#1        #1 is the dimension of the bar
  236. %
  237. % This macro is used to start a change bar.  It assigns a new value to
  238. % the current point and advances the counter for the next point to be
  239. % assigned.  It pushes this info onto \cb@currentlist and then sets the
  240. % point by calling \cb@setBeginPoint with the point number.  Finally, it
  241. % writes the aux file.
  242. %
  243. \def\cb@start#1{\cb@currentpoint=\cb@nextpoint
  244.     \@tempdima=#1\cb@ig                % for \cb@push
  245.     \cb@push\cb@currentlist
  246.     \ifvmode \cb@setBeginPoint\cb@currentpoint
  247.     \else \vbox to 0pt{\vskip -\ht\strutbox        %jump up a line to
  248.     \cb@setBeginPoint\cb@currentpoint        %set point
  249.     \vskip \ht\strutbox}\fi
  250.     \cb@writeAux\cb@advancePoint}
  251.  
  252. \def\cb@advancePoint{\global\advance\cb@nextpoint by 4\cb@ig
  253.     \ifnum\cb@nextpoint>\cb@maxpoint
  254.     \global\cb@nextpoint=\cb@minpoint\relax\fi}
  255.  
  256. %
  257. % \cb@end
  258. %
  259. % This macro is used to end a changebar.  It pops the current point and
  260. % nesting level off \cb@currentlist and sets the end point by calling
  261. % \cb@setEndPoint with the parameter corresponding to the BEGINNING
  262. % point number.  It writes the aux file and joins the points.
  263. %
  264. \def\cb@end{\cb@pop\cb@currentlist
  265.     \cb@setEndPoint\cb@currentpoint
  266.     \advance\cb@currentpoint by1\cb@writeAux}
  267.  
  268.  
  269. %
  270. % \cb@setBeginPoint#1
  271. %
  272. % Assigns position to points #1 and #1+2.  First computes the position.
  273. %
  274. \def\cb@setBeginPoint#1{\@tempdimb=\hoffset
  275.     \advance\@tempdimb by\oddsidemargin
  276.     \advance\@tempdimb by -\changebarsep
  277.     \special{ln03:defpoint \the#1(\the\@tempdimb,)}\cb@ig
  278.     \@tempcnta#1\advance\@tempcnta by2\@tempdimb=\hoffset
  279.     \advance\@tempdimb by\evensidemargin
  280.     \advance\@tempdimb by\textwidth
  281.     \advance\@tempdimb by\changebarsep
  282.     \special{ln03:defpoint \the\@tempcnta(\the\@tempdimb,)}}
  283.  
  284. %
  285. % \cb@setEndPoint#1
  286. %
  287. % Assigns position to point #1+1 and point #1+3.  Then does a connect
  288. % special to join #1 and #1+1 or to join #1+2 and #1+3.  Assumes that
  289. % width of bar is given in \@tempdima
  290. %
  291. \def\cb@setEndPoint#1{\@tempcnta=#1\advance\@tempcnta by1\cb@ig
  292.     \@tempdimb=\hoffset
  293.     \advance\@tempdimb by\oddsidemargin
  294.     \advance\@tempdimb by -\changebarsep
  295.     \special{ln03:defpoint \the\@tempcnta\space
  296.     \space(\the\@tempdimb,)}\if@twoside\@tempcntb=#1
  297.     \advance\@tempcntb by3\@tempdimb=\hoffset
  298.     \advance\@tempdimb by\evensidemargin
  299.     \advance\@tempdimb by\textwidth
  300.     \advance\@tempdimb by\changebarsep
  301.     \special{ln03:defpoint \the\@tempcntb\space
  302.     \space(\the\@tempdimb,)}\cb@ig
  303.     {\count9=#1\advance\count9 by2\cb@ig
  304.     \special{ln03:connect \the#1/\the\count9\space\space
  305.     \the\@tempcnta/\the\@tempcntb\space\space\the\@tempdima}}\else
  306.     \special{ln03:connect \the#1 \the\@tempcnta\space\space
  307.     \the\@tempdima}\fi}
  308.  
  309. %
  310. % \cb@writeAux
  311. %
  312. % Writes the string
  313. % \cb@barpoint{\cb@currentpoint}{\thepage}{\cb@tempdima} to the aux
  314. % file.  Assumes that width of bar is in \@tempdima.
  315. %
  316. \def\cb@writeAux{\begingroup \edef\point{\the\cb@currentpoint}\cb@ig
  317.     \edef\level{\the\@tempdima}\cb@ig
  318.     \let\the=0\edef\cb@temp{\write\@auxout
  319.     {\string\cb@barpoint{\point}{\the\cb@pagecount}{\level}}}\cb@ig
  320.     \cb@temp\endgroup}
  321.  
  322.  
  323. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  324. %
  325. %    Macros for Making It Work Across Page Breaks
  326. %
  327.  
  328.  
  329. %
  330. % \@makecol
  331. %
  332. % Modifies the LaTex macros to end the changebars spanning the current
  333. % page (if any) and restart them on the next page.  Does the
  334. % following: It resets special points for this page.  Adds begin bars
  335. % to top of box255.  The bars to be begun are saved in \cb@beginSaves.
  336. % Increments the changebar-internal page counter so that the value
  337. % corresponds to the number of this page in strictly sequential order
  338. % (the LaTeX page number can be reset).  Then it builds the list
  339. % \cb@spanlist, then calls \cb@processActive to process the elements
  340. % on the list, then it executes the original \@makecol.
  341. %
  342. \let\cb@makecol=\@makecol
  343. \def\@makecol{\setbox255=\vbox{\special{ln03:resetpoints \cb@minpoint
  344.         \space\cb@maxpoint}\cb@beginSaves\unvbox255}\cb@ig
  345.     \gdef\cb@beginSaves{}\global\advance
  346.     \cb@pagecount by 1\cb@buildActive
  347.     \cb@processActive\cb@makecol}
  348.  
  349. %
  350. % \cb@processActive
  351. %
  352. % Processes each element on span list.  Each element represents a bar
  353. % that crosses the page break.  There could be more than one if bars are
  354. % nested.  Works as folows:
  355. %
  356. %    pop top element of span list
  357. %    if point null (i.e., list empty) then done
  358. %    else
  359. %        do an end bar on box255
  360. %        save start for new bar at top of next page in \cb@startSaves
  361. %        push active point back onto history list (need to reprocess
  362. %        on next page).
  363. %
  364. \def\cb@processActive{\cb@pop\cb@spanlist
  365.     \ifnum\cb@currentpoint=\cb@nil \else
  366.     \setbox255=\vbox{\unvbox255\cb@setEndPoint\cb@currentpoint}\cb@ig
  367.     \cb@saveBeginPoint\cb@currentpoint \cb@push\cb@history
  368.     \cb@processActive\fi}
  369.  
  370. %
  371. % \cb@saveBeginPoint#1
  372. %
  373. % Saves a \special to begin a point in expanded macro \cb@beginSaves.
  374. % This is then used to start all spanning bars at the top of the next
  375. % page.  It is almost the same as \cb@setBeginPoint
  376. %
  377. \def\cb@saveBeginPoint#1{\@tempdimb=\hoffset
  378.     \advance\@tempdimb by\oddsidemargin
  379.     \advance\@tempdimb by -\changebarsep
  380.     \xdef\cb@beginSaves{\special{ln03:defpoint \the#1(\the
  381.     \@tempdimb,)}\cb@beginSaves}
  382.     \@tempcnta#1\advance\@tempcnta by2\@tempdimb=\hoffset
  383.     \advance\@tempdimb by\evensidemargin
  384.     \advance\@tempdimb by\textwidth
  385.     \advance\@tempdimb by\changebarsep
  386.     \xdef\cb@beginSaves{\special{ln03:defpoint \the\@tempcnta(\the
  387.     \@tempdimb,)}\cb@beginSaves}}
  388.  
  389. \def\cb@beginSaves{}                % initially empty
  390.  
  391.  
  392.  
  393.  
  394. %
  395. % \cb@buildActive
  396. %
  397. % Initializes the spanlist to null.  Pops top of history list.  If point
  398. % is on future page, push back onto history list.  If point on current
  399. % or previous page and odd, add point to span list; if even, pop span
  400. % list since this bar has terminated on current page.
  401. %
  402. \def\cb@buildActive{\xdef\cb@spanlist{e}\cb@pushNextActive}
  403.  
  404. \def\cb@pushNextActive{\cb@pop\cb@history
  405.     \ifnum\cb@currentpoint=\cb@nil \else
  406.     \ifnum\cb@page>\cb@pagecount \cb@push\cb@history \else
  407.     \ifodd\cb@currentpoint \cb@push\cb@spanlist
  408.     \else \cb@pop\cb@spanlist\fi
  409.     \cb@pushNextActive\fi\fi}
  410.  
  411.  
  412.  
  413. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  414. %
  415. %    Macros For Managing The Lists of Bar points
  416. %
  417. % The macros make use of three lists corresponding to \special
  418. % defpoints.  Each list takes the form
  419. %    <element> . . . <element>e
  420. %
  421. % Each element is of the form xxxnyyypzzzl where xxx is the number of
  422. % the special point, yyy is the page on which this point is set, and zzz
  423. % is the dimension used when connecting this point.
  424. %
  425. % The list \cb@history is built from the log information and initially
  426. % lists all the points.  As pages are processed, points are popped off
  427. % the list and discarded.
  428. %
  429. % The list \cb@spanlist is a temporary list used by the output routine
  430. % and contains the list of all bars crossing the current page (there may
  431. % be more than one with nested bars).  It is built by popping elements
  432. % off the history list.
  433. %
  434. % The list \cb@currentlist contains all the current bars.  A \cb@start
  435. % pushes an element onto this list.  A \cb@end pops the top element off
  436. % the list and uses the info to terminate the bar.
  437. %
  438.  
  439. %
  440. % \cb@pop#1        #1 is name of list (e.g., \cb@history)
  441. %
  442. % This pops the top element off the named list and puts the point value
  443. % into \cb@currentpoint, the page value into \cb@page and the bar width
  444. % into \@tempdima.  If the list is empty, returns a void value (\cb@nil)
  445. % in \cb@currentpoint and sets \cb@page=0
  446. %
  447. \def\cb@pop#1{\if e#1\cb@currentpoint=\cb@nil\cb@page=0\else
  448.     \expandafter\cb@carcdr#1#1\fi}
  449.  
  450. \def\cb@carcdr#1n#2p#3l#4e#5{\cb@currentpoint=#1\cb@page=#2\@tempdima=#3\cb@ig
  451.     \xdef#5{#4e}}
  452.  
  453. %
  454. % \cb@push#1
  455. %
  456. % Pushes \cb@currentpoint, \cb@page and \@tempdima onto the top of the
  457. % named list
  458. %
  459. \def\cb@push#1{\xdef#1{\the\cb@currentpoint n\the\cb@page p\the\@tempdima l#1}}
  460.  
  461. %
  462. % \cb@backpush#1#2#3
  463. %
  464. % Pushes #1 #2 and #3 onto the BACK of the history list.  #1 is the
  465. % point value, #2 the page, and #3 the bar width.  This is used for
  466. % initializing the history list from the data in tha .AUX file.
  467. %
  468. \def\cb@backpush#1#2#3{\expandafter\cb@append\cb@history#1n#2p#3l}
  469.     \def\cb@append#1e#2n#3p#4l{\xdef\cb@history{#1#2n#3p#4le}}
  470.  
  471.  
  472. \let\cb@barpoint=\cb@backpush    % all we do is push aux entries onto back
  473.                 % of history list
  474.  
  475.  
  476. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  477. %
  478. %      Macros For Checking That The .AUX File Is Stable
  479. %
  480.  
  481. %
  482. % \document
  483. %
  484. % This is a replacement for the LaTeX \document macro.  The
  485. % replacement makes a copy of the history list (which has just been
  486. % built from the .AUX file) which is used to compare with the new .AUX
  487. % file that will be created.  It also \lets
  488. % \cb@barpoint=\cb@checkHistory to  prepare for checking the new .AUX
  489. % file.
  490. %
  491. \let\cb@document=\document
  492. \def\document{\cb@document\xdef\cb@prevHistory{\cb@history}\cb@ig
  493.     \let\cb@barpoint=\cb@checkHistory}
  494.  
  495. %
  496. % \cb@checkHistory
  497. %
  498. % Pops the top of the original history list (\cb@prevHistory) and
  499. % check to see if the point and page numbers are the same as the
  500. % arguements #1 and #2 respectively.  Prints a warning message if
  501. % different. 
  502. %
  503. \def\cb@checkHistory#1#2#3{\cb@pop\cb@prevHistory
  504.         \ifnum #1=\cb@currentpoint
  505.         \ifnum #2=\cb@page        % do nothing
  506.         \else \cb@error           % page numbers mismatched
  507.         \fi
  508.     \else \cb@error               % point numbers mismatched
  509.     \fi}
  510.  
  511. \def\cb@error{\message{Changebar Warning: Changebar info has changed. %
  512. Rerun to get right.}\gdef\cb@checkHistory##1##2##3{}%
  513. \let\cb@barpoint=\cb@checkHistory}
  514.  
  515.  
  516.  
  517.  
  518. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  519. %
  520. %    Macros For Making It Work With Nested Floats/Footnotes
  521. %        Works for LaTeX 2.09
  522. %
  523.  
  524. %
  525. % \end@float
  526. %
  527. % This is a replacement for the Latex macro of the same name.  All it
  528. % does is check to see if changebars are active and, if so, it puts
  529. % changebars around the box containing the float.  Then it calls the
  530. % original LaTeX \end@float
  531. %
  532. \let\cb@endfloat=\end@float
  533. \def\end@float{\cb@pop\cb@currentlist\ifnum\cb@currentpoint=\cb@nil
  534.     \else \cb@push\cb@currentlist\global\@tempdima=\@tempdima 
  535.         \egroup \global\setbox
  536.     \@currbox=\vbox{\cb@start\@tempdima\unvbox\@currbox\cb@end}\bgroup\fi
  537.     \cb@endfloat}
  538.  
  539. \let\endfigure=\end@float    % need to rebind these to new def
  540. \let\endtable=\end@float
  541.  
  542. %
  543. % \@footnotetext#1
  544. %
  545. % Replacement for the LaTeX macro of the same name.  Simply checks to
  546. % see if changebars are active and if so wraps the macro arguement
  547. % (i.e., the footnote) in changebars.
  548. %
  549. \let\cb@footnote=\@footnotetext
  550. \long\def\@footnotetext#1{\cb@pop\cb@currentlist\ifnum\cb@currentpoint=\cb@nil
  551.     \cb@footnote{#1}\else \cb@push\cb@currentlist
  552.     \edef\cb@temp{\the\@tempdima}\cb@ig
  553.     \cb@footnote{\cb@start{\cb@temp}#1\cb@end}\fi}
  554.  
  555. %
  556. % \@mpfootnotetext#1
  557. %
  558. % Replacement for the LaTeX macro of the same name.  Same thing as
  559. % \@footnotetext.
  560. %
  561. \let\cb@mpfootnote=\@mpfootnotetext
  562. \long\def\@mpfootnotetext#1{\cb@pop\cb@currentlist
  563.         \ifnum\cb@currentpoint=\cb@nil
  564.     \cb@mpfootnote{#1}\else \cb@push\cb@currentlist
  565.     \edef\cb@temp{\the\@tempdima}\cb@ig
  566.     \cb@mpfootnote{\cb@start{\cb@temp}#1\cb@end}\fi}
  567.  
  568. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  569.